package cn.edu.hunau.utils;

import jakarta.servlet.http.HttpServletRequest;

import java.io.BufferedReader;
import java.io.IOException;

/**
 * @Author 苏佳
 * @Date 2022 11 15 21 35
 **/
public class PayLoadUtils {
    public static String reader(HttpServletRequest req) throws IOException {
        StringBuilder sb = new StringBuilder();
        BufferedReader reader = req.getReader();
        char[] buffer = new char[1024];
        int len=-1;
        while ((len=reader.read(buffer))!=-1){
            sb.append(buffer,0,len);
        }
        return sb.toString();
    }
}
